﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="admin_phsj_drsj.aspx.cs"
    Inherits="admin_phsj_drsj" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>材料数据_导入数据</title>

    <script type="text/javascript" language="javascript" src="admin/js/jquery-1.3.2.min.js"></script>

    <link href="admin/css/style_update.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" language="javascript">
     
     //浏览按钮点击触发事件服务器读取上传文件
     function fileupload_click()
     {    
        var obj = document.getElementById("<%=Button_upload_click.ClientID %>");    
        if(obj)
          {
//            alert(obj.id+"2");
            obj.click();
           }
      }

     //数据表数据信息显示
     function datashow()
     {
         var obj1 = document.getElementById('data_title'); 
         var obj2 = document.getElementById('data_table');
         obj1.style.display='block';
         obj2.style.display='block';
      }
      
      //数据表数据信息隐藏
      function datahide()
      {
         var obj1 = document.getElementById('data_title'); 
         var obj2 = document.getElementById('data_table');
         obj1.style.display='none';
         obj2.style.display='none';
      }
       
      function mb_show_hide()
      {
           var obj = document.getElementById('div_mb'); 
           if(obj.style.display=="none")
          {
         //显示信息
           obj.style.display="block";
          } 
          else
          {
        //隐藏信息
           obj.style.display="none";
          }
      }
      
      function mb_hide()
      {
           var obj = document.getElementById('div_mb'); 
           obj.style.display="none";
      }
      
      function mb_show()
      {
           var obj = document.getElementById('div_mb'); 
           obj.style.display="block";
      }
       //警告消息
     function warning(msg)
     {
        $("#txt_warning").html(msg);
//        alert(msg);
        $("#div_warning").show();	 
     } 
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div style="display: none;">
            <asp:Button ID="Button_upload_click" runat="server" Text="Button" OnClick="Button_upload_click_Click" />
        </div>
        <div class="right_main">
            <div class="location">
                <div class="kou">
                </div>
                <div class="koufont">
                    系统管理</div>
                <a href="#" class="one ">材料数据 ></a> <a href="#" class="two">导入数据</a>
            </div>
            <br />
            <%--class="info clear" --%>
            <div>
                <div class="info_border clear">
                    <div class="title" onclick="mb_show_hide();">
                        <div class="right_tl1">
                        </div>
                        <div class="right_tl2">
                            材料数据标准模板
                         </div>
                    </div>
                    <div class="text_table">
                        <asp:Image ID="Image2" runat="server" ImageUrl="admin/css/image/excel.jpg" Width="14px"
                            Height="15px" />
                        <a href="files/download/材料数据表标准模板.xls" target="_blank">点击下载标准模板</a>
                        <%--<asp:Image ID="Image1" runat="server" ImageUrl="~/image/excel-icon.jpg" Width="18px" Height="18px" />--%>
                    </div>
                    <div class="title" onclick="mb_show_hide();">
                        <div class="right_tl1">
                        </div>
                        <div class="right_tl2">
                            材料数据早期版本管理</div>
                    </div>
                    <div class="text_table">
                        <div id="div_mb" style="overflow-y: auto; width: 100%; height: 150px;">
                            <asp:GridView CssClass="grid_s" ID="GridView2" runat="server" AutoGenerateColumns="False">
                                <Columns>
                                    <asp:BoundField DataField="id" HeaderText="编号">
                                        <HeaderStyle Width="30px" />
                                    </asp:BoundField>
                                    <asp:BoundField DataField="fn" HeaderText="名称"></asp:BoundField>
                                    <asp:TemplateField>
                                        <ItemStyle HorizontalAlign="Center" />
                                        <HeaderStyle Width="80px" />
                                        <ItemTemplate>
                                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("pth") %>' Text="点击下载"></asp:HyperLink>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField ShowHeader="False">
                                        <ControlStyle CssClass="button_U" Height="23px" Width="50px" />
                                        <HeaderStyle Width="50px" />
                                        <ItemTemplate>
                                            <asp:Button ID="Bt_del" runat="server" CausesValidation="False" CommandArgument='<%# Eval("fn") %>'
                                                OnClientClick="javascript:return confirm('真的要删除吗？'); " Text="删除" OnClick="Bt_del_Click" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" />
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView>
                        </div>
                    </div>
                    <div class="title">
                        <div class="right_tl1">
                        </div>
                        <div class="right_tl2">
                            本地Excle上传</div>
                    </div>
                    <div class="text_table">
                        <div>
                            选择上传的Excel文件：
                            <asp:FileUpload ID="FileUpload1" CssClass="input_text" runat="server" Height="23px"
                                Width="392px" onchange="fileupload_click();" />
                            <asp:Button ID="Btmb_Upload" class="button_U" runat="server" Text="将Excel文件保存至服务器"
                                Width="200px" Height="19px" OnClick="Btmb_Upload_Click" /></div>
                    </div>
                    <div class="title">
                        <div class="right_tl1">
                        </div>
                        <div class="right_tl2">
                            选择上传表格</div>
                    </div>
                    <div class="text_table">
                        <div>
                            选择上传的Excel表格：
                            <asp:DropDownList ID="DropDownList1" CssClass="input_text" runat="server" AutoPostBack="True"
                                Height="23px" Width="327px" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:Button ID="Button1" class="button_U" runat="server" Text="导入" Width="61px" OnClick="Button1_Click"
                                Height="19px" />
                        </div>
                    </div>
                    <div id="div_warning" class="warning margin_div" style="display: none;">
                        <img src="admin/css/image/warning.jpg" width="21" height="23" /><span id="txt_warning"></span>
                    </div>
                    <div class="title" id="data_title">
                        <div class="right_tl1">
                        </div>
                        <div class="right_tl2">
                            数据显示</div>
                    </div>
                    <div class="text_table" id="data_table">
                        <div style="overflow-y: auto; width: 100%;">
                            <asp:GridView ID="GridView1" runat="server" CssClass="grid_s">
                            </asp:GridView>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
